<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
                   http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.15.xsd">
    <changeSet id="init-table-TENNIS_USERS_TENNIS_ROLES-1" author="alisitsin">
        <preConditions onFail="MARK_RAN">
            <not>
                <tableExists tableName="TENNIS_USERS_TENNIS_ROLES"/>
            </not>
        </preConditions>
        <createTable tableName="TENNIS_USERS_TENNIS_ROLES">
            <column name="TENNIS_USER_ID" type="integer" remarks="Идентификатор пользователя сервиса (ссылка на таблицу TENNIS_USERS)">
                <constraints foreignKeyName="FK_TENNIS_USERS_TENNIS_ROLES_TENNIS_USERS" referencedTableName="TENNIS_USERS"
                             referencedColumnNames="TENNIS_USER_ID" nullable="true"/>
            </column>
            <column name="TENNIS_USER_ROLE_ID" type="integer" remarks="Идентификатор роли пользователя сервиса (ссылка на таблицу TENNIS_USER_ROLES)">
                <constraints foreignKeyName="FK_TENNIS_USERS_TENNIS_ROLES_TENNIS_USER_ROLES" referencedTableName="TENNIS_USER_ROLES"
                             referencedColumnNames="TENNIS_USER_ROLE_ID" nullable="true"/>
            </column>
        </createTable>
        <comment>create table TENNIS_USERS_TENNIS_ROLES</comment>
    </changeSet>

</databaseChangeLog>